import Utils from "./Util";

export default class UserData {
    public static headImg: cc.Node = null;
    public static nick: string = "";

    public static init(): void {
        this.headImg = new cc.Node();
        this.headImg.addComponent(cc.Sprite);
        if (typeof gmbox != 'undefined') {
            gmbox.login({
                loginOpts: {
                    "appId": "123"
                },
                callback: (info: gmbox.IUserInfo) => {
                    console.log('请求用户信息')
                    console.log(info)
                    // Utils.LoadHeadImg(this.headImg, info.avatar)
                    this.nick = info.userName;
                }
            });
        }
    }
}